Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reusify

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reusify

Reuse objects and functions with style

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37M
decreased by-7.55%
Maintainers
1
Weekly downloads
 
Created

What is reusify?

The reusify npm package is designed to create a fast and low overhead object pool. It allows developers to reuse objects instead of creating new ones, which can help in reducing garbage collection pressure and improving performance in Node.js applications.

What are reusify's main functionalities?

Object Pooling

This feature allows you to create a pool of reusable objects. The `get` method is used to acquire an object from the pool, and the `release` method is used to return the object to the pool for future reuse.

const reusify = require('reusify')

function MyObject () {
  this.next = null
}

const pool = reusify(MyObject)

function acquire () {
  const obj = pool.get()
  obj.foo = 'bar'
  release(obj)
}

function release (obj) {
  pool.release(obj)
}

Other packages similar to reusify

Keywords

FAQs

Package last updated on 26 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc